if(!dojo._hasResource["market.widgets.component.Configuration"]){dojo._hasResource["market.widgets.component.Configuration"]=true;
require(["dojo/_base/declare", "dijit/_Widget","dojo/query"],function(declare,_widget,query){
declare("market.widgets.component.Configuration",[_widget],{
show:function(){
   _w=this;
   dojo.require("dijit.Dialog");
   dojo.require("dijit.TitlePane");
   dijit.registry.remove('_market_divDialog');
   var _dialog = new dijit.Dialog({
      title:'Configuration',
      href:'participant/configuration',
      style: 'height:600px; width:800px',
      parseOnLoad: true
   },'_market_divDialog');
   dojo.connect(_dialog,"onLoad", function(){
      _w._initMenu();
   });
   _dialog.show();
},
_listMyFriends:function(){
   _w=this;
   var args = {ajaxUrl:'participant/friend/list',contentId:'configurationCenter',callback:function(data){
      _w._initFriend('myfriends');
   }};
   SYSTEMWIDGET.ajaxWidget(args).callXhrGet();
},
_listLockedFriends:function(){
   _w=this;
   var args = {ajaxUrl:'participant/friend/lockedList',contentId:'configurationCenter',callback:function(data){
      _w._initFriend('locked');
   }};
   SYSTEMWIDGET.ajaxWidget(args).callXhrGet();
},
_waitingFriends:function(){
   _w=this;
   var args = {ajaxUrl:'participant/waitingAccept',contentId:'configurationCenter',callback:function(data){
      _w._initFriend('waiting');
   }};
   SYSTEMWIDGET.ajaxWidget(args).callXhrGet();
},
_initFriend:function(keyAction){
   _w=this;
   query('#friend a','configurationCenter').onclick(function(){
      var args = {ajaxUrl:query('input[type="hidden"]',this)[0].value,contentId:'configurationCenter',postData:'',callback:function(data){
         switch(keyAction){
         case 'myfriends':
            _w._listMyFriends();
            break;
         case 'waiting':
            _w._waitingFriends();
            break;
         case 'locked':
            _w._listLockedFriends();
            break;
         }
      }};
      SYSTEMWIDGET.ajaxWidget(args).callXhrPostJSON();
   });
},
_initMenu:function(){
   _w=this;
   query('#mainMenu li > a').onclick(function(){
      var results=query('input[type="hidden"]',this);
      var keyAction=results[0].value;
      switch(keyAction){
      case '1':
         _w._listMyFriends();
         break;
      case '2':
         _w._waitingFriends();
         break;
      case '3':
         _w._listLockedFriends();
         break;
      }
   });
}
});});}


